{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>评论管理</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <input type="hidden" name="id" value="{$list.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" value="{$list.order_number}"  placeholder="请输入设施名称" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">住户姓名</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200"  value="{$list.realname}"  class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" value="{$list.phone}"  class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">评论时间</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" value="{:date('Y-m-d')}" placeholder="请输入评论时间" class="layui-input" disabled>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">评论内容</label>
            <div class="layui-input-4">
                <textarea class="layui-textarea"  disabled>{$list.content}</textarea>
            </div>
        </div>
		<div class="layui-form-item">
            <label class="layui-form-label">评论图片</label>
            <div class="layui-input-4">
                {volist name='list.images' id='vo'}
                <img src="{$vo}" alt="" style="width: 150px;height: 120px;">
                {/volist}
                
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
           <div class="layui-input-4">
            <input type="radio" name="status" lay-verify="required" value="0" title="待审核" {$list.status == 0?"checked":""}>
              <input type="radio" name="status" lay-verify="required" value="1" title="审核通过" {$list.status == 1?"checked":""}>
              <input type="radio" name="status" lay-verify="required" value="2" title="审核不通过" {$list.status == 2?"checked":""}>
           </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="submit" lay-submit="" lay-filter="sys">{:lang('submit')}</button>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer','upload'], function () {
        var form = layui.form,layer = layui.layer,upload = layui.upload,$ = layui.jquery;
		form.verify({
            title: function(value){  
						if(value == ''){  
							return '请输入标题！';  
						}  
					},
				logo: function(value){  
						if(value == ''){  
							return '请输入后台标题！';  
						}  
					}			
				});
		//普通图片上传    后台登录页背景图片
        var uploadInst2 = upload.render({
			elem: '#logoBtn2'
            ,url: '{:url("UpFiles/upload")}',
            accept:'images',
            acceptMime: 'image/*'
            ,size:0
            ,multiple:true
            ,number:1
            ,before: function(obj){
                obj.preview(function(index, file, result){
                    $('#SLogo2').attr('src',result); //图片链接（base64）
                });
            }
            ,done: function(res){
                    if(res.errorCode==8888){
                        $('#logo2').val(res.url);
                    }else{
						$('#SLogo2').attr('src','');
                        layer.msg(res.msg,{time:2000,icon:2});
                    }
                }
        });
        //提交监听
        form.on('submit(sys)', function (data) {
			$("#submit").attr({ disabled: "disabled" });
            loading =layer.load(1, {shade: [0.1,'#fff']});
            $.post("{:url('hotel/commentEdit')}",data.field,function(res){
                layer.close(loading);
                if(res.errorCode == 8888){
                    layer.msg(res.msg,{icon: 1, time: 1000},function(){
                        location.href = '{:url("hotel/comment")}';
                    });
                }else{
					$("#submit").removeAttr("disabled");
                    layer.msg(res.msg,{icon: 2, time: 1000});
                }
            });
        })
    })
	

</script>


</body>
</html>